enable working from 127.0.0.1

There was some bugs when running the website using 127.0.0.1. fixed that;