fix bug in reactive code