changed to onAttach