fixed a long standing bug in recurrent net gradient