fixing a bug in the exported prolog rules