Minor changes to edit functions
- change the condition for if-else statement