Fixed an issue with adding/editing