Fix getting attribute from local thread.