Return non-negtive error in order to print right error msg