Finally fixed previous/next buttons not working properly..