fixed bug with database authentication