revised code to handle permissions and fetch all FB data at one go