added length check for url and path