some debugging shit
It compiles
Debugging notes
Refactor resource
Initial wait
Ref debugs
Fix deadlock