previous button implementation