Yes, both are correct!

(I'd prefer the imperfect, "practicaba", but nothing wrong with the perfect form.) (Have you ever read Antonio Machado? There is one of his poems that goes,
Era un niño que soñaba un caballo de cartón.
Abrió los ojos el niño y el caballito no
vio... The imperfect
soñaba gives you the "progressive/durative" idea. The perfect, (Abrió, vio) gives you a "past" sense that it is "over". I.e., the kid was dreaming about the horse-toy (progressive), he
opened his eyes and he didn't see the horse anymore. (The dream was over)
.
You can find the rest of the poem Googling it, but the next section goes like this,
Abrió los ojos el niño
y el caballito no vio.
Con un caballito blanco
el niño volvió a soñar;
y por la crin lo
cogía...
¡Ahora no te escaparás!
Apenas lo hubo cogido,
el niño se despertó.
Tenía el puño cerrado.
¡El caballito voló!
I have put in
brown the imperfect form of the verb. You can check the other verbs and maybe try to translate it into English. (It is just a suggestion, as I've seen you are dealing with these perfect/imperfect 'dilemma', if I may call it like this.) I hope this doesn't go above your level, but if any question let me know.