Dialogs when adding records. #10

refactoring code
Dialog now closes after a successful create.