BUGFIX: revision of lock after goto