Fixed issue with database