adding validation and resource limits