fixed binding lock by not having global variables