added application arguments and defined error handling