added a check for last value to axis component