fix writemime issues
remove specialised writemime method
fix boundserror