more improvements to PREPARE command