Fixed mainactivity problem that crashed if mainfragment became detatched. Began login implementation