fixed incorrect bounds problem