Credits to Tamás Gulácsi for finding out about the state parameter. Change-Id: I139eb4f74e607278c9aee93fd40c25ae081d47e3