fixed a bug in calculating xlimits