clean up and bug fix for preferences