added in changactive function and fixed log in