Move FB callback outside of click function