Fixed duplicated function