added batch file, some more error handling