changed is_running function