cast to string before replace()