Fix css rule logic