fixed semantic analysis