move locking out to separate file
fix inverted logic