Fixed the database call