added halt for bad post
added more error codes