try comparing against strings instead of integers (IF $3rd = "1")
_________________________