fix error allowing negative px length