replaced the hash syntax of the payload with a new one and also removed the check device.nil from the conditionals