Fixed bug with prepare call