improve the tail wrapper function to put color in error lowercase