Grafting of thiophenecarboxylates into magnetic transition metal hydroxide layers