fix bugs that was occured when user hit submit