Shared variables fix