How the change of contact angle occurs for an evaporating droplet: effect of impurity and attached water films