fixed two persistent bugs