add error handling for composition