defining variable in the right place