pre submit code