Refactored added check for minHeight