Added more logging
More debug logging
Fixed typo
Moved locking code to after post to avoid missing data