resolved issue #1 plus some cross browser improvements