fix the memory issue
removing magic numbers