Make cancel button work

This can be used to make the cancel button work