better fix
made states work with nil callbacks