update code for BAE