check sensornode state before executing stuff