added helper function to display alert messages