tried to destroy the session first but ended up with a segfault