Modified addMarker for testability