Solving the mystery of the periodicity in the Seyfert galaxy NGC 6814