Slight revision to Previous button onclick listener