fixed dialog to have remove button and not remove elements on each click on the OK-button. Merged with dropbox-version. Added length limit of activity. Added some comments and cleaned up in some code