adding the valid transition check for status changes