more cleanup, return proper message on value error