I think this should fix the database multiple calls issue