bug fix for amount x and y length