Added cancel button and functionality to save button