fix color detection