fixed bug in tensor definition