Melatonin is a hormone which reduces as one ages, it is responsible for sleep cycle(circadian rhythm) so insomnia is a part and parcel of old age, first accept it.
Yes sleeping pills are harmful if taken for long time, since they are habit forming(addiction). The body is not meant to be managed by chemicals form outside sources(exogenous drugs). Use them responsibly.
Next Steps
if the problem persists or increases consult a psychologist or psychiatrist once.
Health Tips
Increase your PHYSICAL ACTIVITY (best remedy) and do some meditation/yoga.
indulge in new hobbies, keep yourself occupied and don't sleep in the afternoon.