implementing message of warning and success