improve handling of corner case