Fixing bug where it locks