modified for cross compile