method to set language