Error handling, changed Script to a delegate type