Dirty hack to prevent infinite looping