added: error and type handling