Add before_index & before_safe hooks