Fixed bug that was caused by wrong data type.