Fix possible bug when clicking carousel buttons