fix beam and cursor not being always aligned