Made fan gate function work by testing with a FB app