Double free bug in activities fixed