Fixed issues in loading from the database. New changes in progress (unstable)