fix edit tab bug and add unit test

@dmitchell @cahrens @adampalay 

Here's the hotfix PR