Removed duplicated and wrong code