added is_running() function