added edit functionality and updated state to be a string