gravity switch working