Ok, I had create a variable(currentType) for this purpose, and remove this function.