basename was causing an error