Fixed small bug for no database condition