fixed gentoo function