How to Use AND logic with if statement