I added setTimeout because otherwise tests didn't pass properly