avoid locking and throw exception when exception occurs