Bug fix/unserialize error

Fixed unserialize error by utilizing is_serialized function.