How to avoid users to go back and have duplicated records?