Cleanup for submit