displayLast function fix