Implementing text log and fixing the infinite loop redirect