added more safety locking