fix file after function bug