Added discard button functionality