fix reference compare bug, plus work for auto_now