Minor change on var assignment for onOff function.