make sure that the variables used below are properly initialized