Modified code for facebook integration