Setting up edit event