Fixed bug with cancel button not workign