added better cross compatibility