Moved removeCompleted function outside of document ready and it still doesn't work