added log function, forced error function to add error tag