modified to support ubuntu