Modified database bug

Fixed database bug