refactored telldusOn into function