added few convenience constructors and made sure that data is deleted when a prepare failed