Add parenthesis around f since it has side effect