modified for linux support