tricky else if when checking mode causing 404 to fire.