reimplemented logic :(