Try to avoid null pointer exceptions in script manager