LUN-1372: fixed double encoding when hitting cancel button