fixed issue with outofbounds