fixed the runtime error