BUG Fixed issue with components being flushed before being written to the database