fix hal prev, next bugs