remove dev.off() in function