Fixed onBeforeClose bug and added changes to Readme

Signed-off-by: JonasStattin <jonas@vinnovera.se>