protect against negative gap size