Added beforeAction and afterAction to Scene class