JC: commented out wf_state.present in model which causes error in production.
JC: updated version.