added functionality to check for null required values