added args[0] and fixed EOF