modified to compatable to all browser