Adjusted logic for querying the FB api