Added proper login locking