improved error handling
move map functions to slots