bug fixes with submitting only once