fixing cancel button issues