added desktop detection