fix a bug on firefox implementation