updated faye js code