fixed bug where add/edit wasn't working