added conditions for url and no selection