adapted for ubuntu