handle type change