fixed logical bound error