Adding facebook handshaking logic