Problem using multiple conditional statements