Add return value on "exec" function

Add return value on "exec" function, so I change command result handling.