added method to draw text when needed by events