fixed bug with bad enabling/disabling of buttons, fixed bug when adding a duplicate application