bounds calculation fix