fix faye bugs and tighten security