Bugfix with replace