catch index errors