debugging, locking, does not work though