Fix for "wrong type of data" error