fixed bugs, put loading indicator, removed unwanted code and some more
optimizations