Switch before script and after script around