switch for responseType