double checking to prevent infinite loop