Added get_activity and changed the code