Fixed bug when supplying function for field.create