fixed bug in parrot code