How to avoid duplicated submissions