Exceptions and script locking