Added result var to end task
Added sleep