Fixing issue with accessing objects