First improvement

Made a better try/except errorhandling
and removed some problems