fix bug where submit was causing crashes