fixed the duplicate function?