Assign -1 to deafult status code when error occurs