fixed bug, and changed -a flag