fixed log functionality