Check if var is set first