fix hook functions prev and next exceptions