Fix actions on prev, next, replace buttons