passed testing, got rid of asprintf for getpath. Still need to add in the channel checks