added a bool to avoid double-time