Added second onbeforeaction