Fix cancel button from throwing 500 error