fixed  issues with ret and print