conditions of show hide working incorrectly