bugs fixed at checking duplicated function