check for null pointer before calling starting or stopping