changes to ret behaviour