made next/previous only appear if needed
fixed merge conflict