changed to redirect
added else statements and triple equals to undefined user check