Fixed cursor limit function