--solved --- thanks paul

forgot the end if in above code