Resolved compilation error, hangs on runtime