Fixed bug in Database manager