improved url and alerts handling