added arg and some error checking
added name