fix syntax in method generator