fixed bug in A*