fixed duplicated function