fixed {error, emfile} during migration #1015