animation and next/previous buttons fix