fixing function

added curley brackets to first function