fixed two bugs preventing the bounds work properly