rearranged traits to compile but acces violation error