move standard error function to lib/