moved validation above dispatching