Added more variable validating

Added more variable validating