Manage errors and added tools.js