moved return status to last line of main