Bug in database fixed