improvement for the last commit (check for too small values while resizing, not after)