Fixed java.lang.IllegalArgumentException upon configurationchange

fix for issue
uncatchable java.lang.IllegalArgumentException upon configuration change #11