added function for detect displays