Updating code as per review comment