added compatibly with OS X