after some debugging