Fix possible class not found fatal error.
Add break statement to avoid execution of unwanted post hooks.
Execute post hooks only if the state column has been modified.