Add locking, unfortunately a lot of changes because of auto format function.
Change compile script in a task instead using timer