Remove file locking
Use before_filter in Rails instead of global path