addBefore hook