handling illegal returns properly