typeError with views