fixed edge case bug with padding