added type and fixed nag