adding before hooks