bug fixed with capturing