flyttade in em.close() i finally