bugfix: use continue instead of next() in python3 for loop and make try-catch inside the for loop not outside

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>