fix: unused variable has been removed.
fix: unused variable has been removed and global variable err changed to local variable.