fixs problems and add Xresoures