added cross browser support