add before route handler