added an error check for better usability and incremented the version number