fork / changed to support firefox