I think there is an identation problem here, where is path first defined if not?