bug fix of max_y