updated for if condition