setwd added in functions