Did you try stepping through each line with F8 to debug and find where it errors?