added off function
added some tests for off