Added some exception handling. if parent path does not exists, raise a keyvalue error