Resolve ed is undefined issue