endsWith exists only in firefox
typo: some logs were printed on stdout