added handling for the prolog lists problems