minor change to the code, fixing the edge case