move 'import os' to top of file