fixed run time error bug