Updated code based on response from Developer