Made the cancel button work