removed removing of tempfile, added tests