additional input validation to avoid nil bar ids