fixed bug in database/app