fixed out of bounds bug with selling