fix conditional check