type checking still wrong