fix bug wrong function name applyflat