fixing duplicated variable