fixed issue with web console. Cleaned up code