Fixed locks issue

This should fix the locks issue