added null ptr check for the intent when starting the service