Added message handler
Added ability to set referrer