fixed a bug in rat