Cancel button and save dialog implemented