added color detection