fixed validateargs to exit on error