Fixing errors in error handling when license is not valid