some changes for better mac support