add beforeExecute and afterExecute