If state is empty, it throws NullPointerException