corrected the status msg.
added created the status check.
removed the unwanted code.
introduced the check for PLSQL function