Use basename instead of substr strrpos