added type check in SET_DATE