Effect of massive fields on inflation