fix makefile error
fix bug; added logging