check task!=null before calling execute on it