reactivated and fixed mksession stuff