updating css class based on input