added method to convert string to int in EventHandler