update for demo src
add support for return codes