cleand abit more
added small error handling