Made locks
fixed some errors...