add rank to module
correction on error handling
fix typos