Fix for TypeError