Call to a member function fetch_object() on bool