Check if valid URL and take away the space characters