Something goes wrong when trying connenct to database