Throw error when necessary
Remove unnecessary library