Fixed issue with database refresh