adding checking for http uri and leading spaces