add method for parsing object to dictionary