added method to marker class to automatically update its color