checking if prefix is a prefix rather than substr