Make sure that before and after hooks are called