returncode function added