add validation of layout function inputs