Added goodbyefunc() to main activity