changed pl sql code to be proper code