Fixed bug whenn filling in the DB