fix bug alert
fixed bug in current descision logic in js