added dead flag to disable input when dead