Rename function add2Log to addAtEnd